package com.domor.xxx.common.core.domain;

import lombok.Data;

import java.util.List;

/**
 * Tree基类
 *
 * @author liyuyang
 */
@Data
public class TreeEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 节点ID
     */
    private int id;

    /**
     * 节点名称
     */
    private String text;

    /**
     * 节点展开状态 'closed', 'open'
     */
    private String state;

    /**
     * 是否选中
     */
    private boolean checked;

    /**
     * 子级树
     */
    private List<TreeEntity> children;

    /**
     * 自定义属性
     */
    private Object attributes;

    public TreeEntity(){
    }

    public TreeEntity(int id, String text){
        this.id = id;
        this.text = text;
        this.state = "open";
    }

}